<#import "../../layout.html" as c>
    <#import "../../list_layout.html" as list>
        <#assign alertList = []/>
        <@c.html title="平仓中列表">
        <!-- ================== 开始页面级CSS调用 ================== -->
        <link href="${pluginsRoot}bootstrap-wizard/css/bwizard.min.css" rel="stylesheet"/>
        <!-- 日历控件 -->
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" rel="stylesheet"/>
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" rel="stylesheet"/>
        <!-- ================== 结束页面级CSS调用 ================== -->
        <@list.html title="平仓中列表" subTitle="平仓中列表" alertList=alertList permi="sys:myOrder:save" addBtn=true searchHint="">

        <!--&lt;!&ndash; 开始用户权限参数 &ndash;&gt;-->
        <!--<@shiro.hasPermission name="sys:myOrder:edit">-->
        <!--<input type="hidden" id="editPermi" value="1"/>-->
        <!--</@shiro.hasPermission>-->
        <@shiro.hasPermission name="sys:orderPingcang">
        <input type="hidden" id="pingCangPermi" value="1"/>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="sys:order:sell">
        <input type="hidden" id="sellPermi" value="1"/>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="sys:order:back">
        <input type="hidden" id="backPermi" value="1"/>
        </@shiro.hasPermission>
        <!-- 结束用户权限参数 -->
        <input type="hidden" value="${admin.userId}" id="userId">
        <input type="hidden" value="${admin.roleId}" id="roleId">

        <!-- 开启卖出模态窗口 -->
        <div class="modal fade" id="addModal" tabindex="-1" role="dialog">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title"> 点卖 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsSell" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
                    </div>
                    <div class="modal-body">
                        <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsSell">
                            <li class="m-b-3">请检查股票名称和股票代码，填写卖出价格和卖出数量</li>
                        </ul>
                        <form id="addForm"  class="form-horizontal" autocomplete="off" action="${adminRoot}order/pingcang.json" method="post" data-parsley-validate="true">
                            <input type="hidden" name="id" class="oId">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">股票名称&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                    <input type="text" class="form-control" id="equityName" disabled/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">股票代码&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                    <input class="form-control invite-code" id="equityCode" readonly title="股票代码"/>
                                </div>
                                <div class="col-sm-3 control-span">
                                    <input class="form-control invite-copy" id="copy-stock-code" type="button" value="复制代码" title="复制股票代码" data-clipboard-action="copy" data-clipboard-target=".invite-code"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">买入数量&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                    <input type="text" class="form-control inviteNumber" id="buyNumber" readonly/>
                                </div>
                                <div class="col-sm-3 control-span">
                                    <input class="form-control invite-copy" type="button" value="复制数量" title="复制股票数量" data-clipboard-action="copy" data-clipboard-target=".inviteNumber"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">买入价格&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                    <input type="text" class="form-control" id="buyDealPrice" disabled/>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">卖出数量&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                <input type="text" class="form-control" name = "sellDealNumber" id="sellDealNumber" data-parsley-required="true" min="0" maxlength="11"
                                       onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                       onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">卖出价格&nbsp;: </label>
                                <div class="col-sm-7 control-span">
                                <input type="text" class="form-control" name = "sellDealPrice" data-parsley-required="true" min="0" maxlength="11"
                                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="addForm" nc-ajax-submit>确认提交</a> </div>
                </div>
            </div>
        </div>
        <!-- 结束卖出模态窗口 -->

        <!-- 开启撤回模态窗口 -->
        <div class="modal fade" id="editModal" tabindex="-1" role="dialog">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title"> 管理员管理 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsAdd" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
                    </div>
                    <div class="modal-body">
                        <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsAdd">
                            <li class="m-b-3">如需修改密码请填写登录密码和重复密码，否则密码处请留空</li>
                        </ul>
                        <form id="editForm" autocomplete="off" action="${adminRoot}admin/edit.json" method="post" data-parsley-validate="true">
                            <input type="hidden" id="adminId" name="adminId"/>
                            <div class="form-group">
                                <label class="control-label">用户名&nbsp;: </label>
                                <input type="text" class="form-control" id="adminName" disabled/>
                            </div>
                            <div class="form-group">
                                <label class="control-label">登录密码&nbsp;: </label>
                                <input type="password" id="password" name="password" class="form-control" placeholder="请输入管理员登录密码" data-tip="tooltip" data-placement="auto" data-original-title="必填项，6-20个大小写英文字母、符号或数字。" data-parsley-length="[6,20]"/>
                            </div>
                            <div class="form-group">
                                <label class="control-label">重复密码&nbsp;: </label>
                                <input type="password" name="password2" class="form-control" placeholder="请再次输入密码" data-tip="tooltip" data-placement="auto" data-original-title="必填项，请确保两次密码输入一致。" data-parsley-equalto="#password" data-parsley-equalto-message="两次输入的密码不一致"/>
                            </div>
                            <div class="form-group">
                                <label class="control-label">权限组&nbsp;: </label>
                                <select name="roleId" class="form-control" data-parsley-required="true" >
                                    <option value ="">- 请选择 -</option>
                                    <#if roleList??>
                                        <#list roleList as role>
                                            <option value ="${role.id}">${role.name}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a> </div>
                </div>
            </div>
        </div>
        <!-- 结束撤回模态窗口 -->

    </@list.html>
<!-- ================== 开始页面级JavaScrip调用 ================== -->
<!--复制控件-->
<script src="${jsRoot}copy/clipboard.min.js"></script>
<script src="${pluginsRoot}bootstrap-wizard/js/bwizard.js"></script>
<!-- 表单checkbox项 -->
<script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
<!-- 日历控件 -->
<script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>
<script src="${jsRoot}myOrderPingcanging/myOrderPingcanging.handle.js"></script>
<script>
    var clipboard = new Clipboard('.invite-copy');
    clipboard.on('success', function(e) {

    });
    clipboard.on('error', function(e) {
        alert('复制失败,请手动复制');
    });

</script>
<!-- ================== 结束页面级JavaScrip调用 ================== -->
</@c.html>